package com.sunfeng.chap5.selectkey;

import java.io.IOException;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.spi.SelectorProvider;

/**
 * SelectorProvider
 * 。给定的对Javax拟机的调用维护了单个系统级别默认调用者实例 它由 provider（）方法返回
 */
public class Test8 {
    public static void main(String[] args) throws IOException {
        SelectorProvider selectorProvider1 = SelectorProvider.provider();
        System.out.println(selectorProvider1);        //sun.nio.ch.WindowsSelectorProvider@74a14482

        ServerSocketChannel  serverSocketChannel = ServerSocketChannel.open();
        SelectorProvider selectorProvider2 = serverSocketChannel.provider();
        System.out.println(selectorProvider2);   //sun.nio.ch.WindowsSelectorProvider@74a14482
        serverSocketChannel.close();


    }
}
